#include <stdio.h>
#define _CRT_SECURE_NO_DEPRECATE


int check(int num);

int main(void) {
	int start, end;
	scanf("%d,%d", &start, &end);
	for (int i = start; i <= end; i++) {
        if (i==1)continue;
		if (check(i) == i) printf("%d\n", i);
	}
	return 0;
}

int check(int num) {
	int sum = 1;
	for (int i = 2; i * i < num; i++) {
		if (num % i == 0) {
			sum += i;
			sum += num / i;			
		}
	}
	return sum;
}